CentOS 7 grub Linux 修改默认的启动操作系统

可以用下面的方法修改grub默认的启动OS。

查看当前的启动内核

1
2
[root@localhost ~]# grub2-editenvlist
saved_entry=CentOS Linux(3.10.0-123.20.1.el7.x86_64) 7 (Core)

查找要默认启动的操作系统名字

1
2
3
4
[root@localhost ~]# cat /etc/grub2.cfg | grep 3.4.44
menuentry 'CentOS Linux (3.4.44) 7(Core)' --class centos --class gnu-linux --class gnu --class os--unrestricted $menuentry_id_option'gnulinux-3.10.0-123.el7.x86_64-advanced-e3146a2a-a237-4081-ba08-dbf258de434a'{
linux16 /vmlinuz-3.4.44 root=/dev/mapper/centos-rootro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/rootcrashkernel=auto vconsole.keymap=us rhgbquiet LANG=en_US.UTF-8
initrd16 /initramfs-3.4.44.img

设置新的默认启动操作系统选项

1
[root@localhost ~]# grub2-set-default  "CentOSLinux (3.4.44) 7 (Core)"

查看是否生效

1
2
[root@localhost ~]# grub2-editenv list
saved_entry=CentOS Linux (3.4.44) 7 (Core)

转载自 http://blog.csdn.net/wjw7869/article/details/47302107